package com.hn658.base.message.notisender.enums;

/**
 * 
 * 消息优先级
 * @author ztjie
 * @date 2015-10-21 下午3:10:23
 * @since
 * @version
 */
public enum NotifyPriority {
    /**
     * 低
     */
    Low(0),

    /**
     * 普通
     */
    Normal(1),

    /**
     * 高
     */
    High(2);

    /**
     * NotificationPriority对应的Value值(Int)
     */
    private int value;

    NotifyPriority(int value){
        this.value = value;
    }

    /**
     * 获取NotifyPriority枚举对应的Value值(Int)
     * @return
     */
    public int getValue(){
        return this.value;
    }

    /**
     * 根据Value值(Int)获取对应的NotifyPriority枚举
     * @param value
     * @return
     */
    public static NotifyPriority getPriorityByValue(int value){
        for(NotifyPriority priority : NotifyPriority.values()){
            if(priority.getValue() == value){
                return priority;
            }
        }
        throw new IllegalArgumentException("未能找到匹配的NotifyPriority:" + value);
    }
}
